#ifndef JGOOGLEPINYIN_H
#define JGOOGLEPINYIN_H

#include <QObject>
#include <QTECore/jsingleton.h>

#define LIST_MAX_NUM  50

namespace QTE
{

class JGooglePinyinPrivate;

class Q_DECL_HIDDEN JGooglePinyin : public QObject
{
	Q_OBJECT
	J_PERMANENT_SINGLETON(JGooglePinyin)

public:
	QString searchCN(const QString &gemfield);
	int choose(int index);
	int cancelChoose();

public:
	void binarySearchEN(const QString &gemfield);
	void matching(const QString &gemfield, bool isEn = true);

public:
	void predicts(const QString &content);

public:
	QStringList chineseList; //汉字缓存
	QString pinYinCache; //实际参与解码的拼音
	QString pinYinText;

private:
	JGooglePinyinPrivate *d_ptr;
};

} //namespace QTE


#endif //JGOOGLEPINYIN_H
